From: Lukáš Tyrychtr Date: Tue, 24 Sep 2024 11:44:15 +0000 (+0200) Subject: bluetooth: When the placeholder is shown, announce it when reaching the toggle X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~173^2^2~207 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3bd68fcfd7a1088e26f8631f27f73e67581413a2;p=gnome-shell.git bluetooth: When the placeholder is shown, announce it when reaching the toggle Previously, the menu would be just empty, without any indication why. Part-of: --- diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index c1d6837a8..794c08cbe 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -1,5 +1,6 @@ import 'gi://GnomeBluetooth?version=3.0'; +import Atk from 'gi://Atk'; import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GnomeBluetooth from 'gi://GnomeBluetooth'; @@ -346,9 +347,19 @@ class BluetoothToggle extends QuickMenuToggle { : _('Turn on Bluetooth to connect to devices'); } + _updatePlaceholderRelation() { + const accel = this.get_accessible(); + const placeholderAccel = this._placeholderItem.get_accessible(); + if (this._deviceSection.actor.visible) + accel.remove_relationship(Atk.RelationType.DESCRIBED_BY, placeholderAccel); + else + accel.add_relationship(Atk.RelationType.DESCRIBED_BY, placeholderAccel); + } + _updateDeviceVisibility() { this._deviceSection.actor.visible = [...this._deviceItems.values()].some(item => item.visible); + this._updatePlaceholderRelation(); } _getSortedDevices() {